using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Extraction
{
    /// <summary>
    /// <para>Extract by Points</para>
    /// <para>Extracts the cells of a raster based on a set of coordinate points.</para>
    /// <para>基于一组坐标点提取栅格的像元。</para>
    /// </summary>    
    [DisplayName("Extract by Points")]
    public class ExtractByPoints : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ExtractByPoints()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input raster</para>
        /// <para>The input raster from which cells will be extracted.</para>
        /// <para>将从中提取像元的输入栅格。</para>
        /// </param>
        /// <param name="_points">
        /// <para>Input points</para>
        /// <para><xdoc>
        ///   <para>The points where values will be extracted from the raster.</para>
        ///   <para>The points are specified as x,y coordinate pairs in the same map units as the input raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将从栅格中提取值的点。</para>
        ///   <para>这些点被指定为与输入栅格相同的地图单位的 x，y 坐标对。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para>The output raster containing the cell values extracted from the input raster.</para>
        /// <para>包含从输入栅格中提取的像元值的输出栅格。</para>
        /// </param>
        public ExtractByPoints(object _in_raster, List<object> _points, object _out_raster)
        {
            this._in_raster = _in_raster;
            this._points = _points;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Extract by Points";

        public override string CallName => "sa.ExtractByPoints";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _points, _out_raster, _extraction_area.GetGPValue()];

        /// <summary>
        /// <para>Input raster</para>
        /// <para>The input raster from which cells will be extracted.</para>
        /// <para>将从中提取像元的输入栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Input points</para>
        /// <para><xdoc>
        ///   <para>The points where values will be extracted from the raster.</para>
        ///   <para>The points are specified as x,y coordinate pairs in the same map units as the input raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将从栅格中提取值的点。</para>
        ///   <para>这些点被指定为与输入栅格相同的地图单位的 x，y 坐标对。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input points")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _points { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para>The output raster containing the cell values extracted from the input raster.</para>
        /// <para>包含从输入栅格中提取的像元值的输出栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Extraction area</para>
        /// <para><xdoc>
        ///   <para>Identifies whether to extract cells based on the specified point locations (inside) or outside the point locations (outside) .</para>
        ///   <bulletList>
        ///     <bullet_item>Inside—A keyword specifying that the cell in which the selected point falls will be written to the output raster. All cells outside the box will receive NoData on the output raster.</bullet_item><para/>
        ///     <bullet_item>Outside—A keyword specifying that the cells outside the input points should be selected and written to the output raster.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>标识是根据指定的点位置（内部）还是外部（外部）提取单元格。</para>
        ///   <bulletList>
        ///     <bullet_item>内部 - 指定将所选点所在的像元写入输出栅格的关键字。框外的所有像元都将在输出栅格上接收 NoData。</bullet_item><para/>
        ///     <bullet_item>外部 - 指定应选择输入点外部的像元并将其写入输出栅格的关键字。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Extraction area")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _extraction_area_value _extraction_area { get; set; } = _extraction_area_value._INSIDE;

        public enum _extraction_area_value
        {
            /// <summary>
            /// <para>Inside</para>
            /// <para>Inside—A keyword specifying that the cell in which the selected point falls will be written to the output raster. All cells outside the box will receive NoData on the output raster.</para>
            /// <para>内部 - 指定将所选点所在的像元写入输出栅格的关键字。框外的所有像元都将在输出栅格上接收 NoData。</para>
            /// </summary>
            [Description("Inside")]
            [GPEnumValue("INSIDE")]
            _INSIDE,

            /// <summary>
            /// <para>Outside</para>
            /// <para>Outside—A keyword specifying that the cells outside the input points should be selected and written to the output raster.</para>
            /// <para>外部 - 指定应选择输入点外部的像元并将其写入输出栅格的关键字。</para>
            /// </summary>
            [Description("Outside")]
            [GPEnumValue("OUTSIDE")]
            _OUTSIDE,

        }

        public ExtractByPoints SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}